<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class Message extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('messages',function ($table){
            $table->string('id')->unique();
            $table->enum('msg_type',['text','video','sound','image']);
            $table->string('content');
            $table->dateTime('created_at');
            $table->dateTime('updated_at');
            $table->string('from');
            $table->string('to');
            $table->enum('type',['group','user']);
            $table->enum('status',[0,1])->default(0);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('messages');
    }
}
